<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        const p = new Promise(function(resolve,reject){
            setTimeout(function(){
                // let data = '数据调取成功'
                // resolve(data)
                let failure = '返回失败'
                reject(failure)
            },2000)
        })

        p.then(function(value){
            console.log(value)
        },function(reason){
            console.error(reason)
        })
    </script>
</head>
<body>
    
</body>
</html>